package com.prothink.threadproject.exception;
/**
 * 全局异常处理类
 * 在返回给前端的异常之前拦截处理一下
 */

import com.prothink.threadproject.common.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler(BisnessException.class)
    public Result<String> handlerBusinessException(BisnessException bisnessException){
        return Result.failure(bisnessException.getMessage());
    }
}
